/*
 * Copyright 2024 The PhoenixOS Authors. All rights reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#define rpc_checkpoint 0
#define rpc_deinit 1
#define rpc_printmessage 2
#define rpc_dlopen 3
#define rpc_register_function 50
#define rpc_elf_load 51
#define rpc_elf_unload 52
#define rpc_register_var 53
#define CUDA_CHOOSE_DEVICE 101
#define CUDA_DEVICE_GET_ATTRIBUTE 102
#define CUDA_DEVICE_GET_BY_PCI_BUS_ID 103
#define CUDA_DEVICE_GET_CACHE_CONFIG 104
#define CUDA_DEVICE_GET_LIMIT 105
#define CUDA_DEVICE_GET_P2P_ATTRIBUTE 107
#define CUDA_DEVICE_GET_PCI_BUS_ID 108
#define CUDA_DEVICE_GET_SHARED_MEM_CONFIG 109
#define CUDA_DEVICE_GET_STREAM_PRIORITY_RANGE 110
#define CUDA_DEVICE_GET_TEXTURE_LMW 111
#define CUDA_DEVICE_RESET 112
#define CUDA_DEVICE_SET_CACHE_CONFIG 113
#define CUDA_DEVICE_SET_LIMIT 114
#define CUDA_DEVICE_SET_SHARED_MEM_CONFIG 115
#define CUDA_DEVICE_SYNCHRONIZE 116
#define CUDA_GET_DEVICE 117
#define CUDA_GET_DEVICE_COUNT 118
#define CUDA_GET_DEVICE_FLAGS 119
#define CUDA_GET_DEVICE_PROPERTIES 120
#define CUDA_SET_DEVICE 126
#define CUDA_SET_DEVICE_FLAGS 127
#define CUDA_SET_VALID_DEVICES 128
#define CUDA_GET_ERROR_NAME 140
#define CUDA_GET_ERROR_STRING 141
#define CUDA_GET_LAST_ERROR 142
#define CUDA_PEEK_AT_LAST_ERROR 143
#define CUDA_CTX_RESET_PERSISTING_L2CACHE 250
#define CUDA_STREAM_COPY_ATTRIBUTES 254
#define CUDA_STREAM_CREATE 255
#define CUDA_STREAM_CREATE_WITH_FLAGS 256
#define CUDA_STREAM_CREATE_WITH_PRIORITY 257
#define CUDA_STREAM_DESTROY 258
#define CUDA_STREAM_GET_FLAGS 262
#define CUDA_STREAM_GET_PRIORITY 263
#define CUDA_STREAM_IS_CAPTURING 264
#define CUDA_STREAM_QUERY 265
#define CUDA_STREAM_SYNCHRONIZE 267
#define CUDA_STREAM_WAIT_EVENT 268
#define CUDA_THREAD_EXCHANGE_STREAM_CAPTURE_MODE 269
#define CUDA_EVENT_CREATE 280
#define CUDA_EVENT_CREATE_WITH_FLAGS 281
#define CUDA_EVENT_DESTROY 282
#define CUDA_EVENT_ELAPSED_TIME 283
#define CUDA_EVENT_QUERY 284
#define CUDA_EVENT_RECORD 285
#define CUDA_EVENT_RECORD_WITH_FLAGS 286
#define CUDA_EVENT_SYNCHRONIZE 287
#define CUDA_FUNC_GET_ATTRIBUTES 310
#define CUDA_FUNC_SET_ATTRIBUTES 311
#define CUDA_FUNC_SET_CACHE_CONFIG 312
#define CUDA_FUNC_SET_SHARED_MEM_CONFIG 313
#define CUDA_LAUNCH_COOPERATIVE_KERNEL 314
#define CUDA_LAUNCH_KERNEL 317
#define CUDA_OCCUPANCY_AVAILABLE_DSMPB 330
#define CUDA_OCCUPANCY_MAX_ACTIVE_BPM 331
#define CUDA_OCCUPANCY_MAX_ACTIVE_BPM_WITH_FLAGS 332
#define CUDA_ARRAY_GET_INFO 400
#define CUDA_ARRAY_GET_SPARSE_PROPERTIES 401
#define CUDA_FREE 402
#define CUDA_FREE_ARRAY 403
#define CUDA_FREE_HOST 404
#define CUDA_GET_SYMBOL_ADDRESS 407
#define CUDA_GET_SYMBOL_SIZE 408
#define CUDA_HOST_ALLOC 409
#define CUDA_HOST_ALLOC_REGSHM 477
#define CUDA_HOST_GET_DEVICE_POINTER 410
#define CUDA_HOST_GET_FLAGS 411
#define CUDA_MALLOC 414
#define CUDA_MALLOC_3D 415
#define CUDA_MALLOC_3D_ARRAY 416
#define CUDA_MALLOC_ARRAY 417
#define CUDA_MALLOC_PITCH 421
#define CUDA_MEM_ADVISE 422
#define CUDA_MEM_GET_INFO 423
#define CUDA_MEM_PREFETCH_ASYNC 424
#define CUDA_MEMCPY_HTOD 440
#define CUDA_MEMCPY_DTOH 441
#define CUDA_MEMCPY_SHM 442
#define CUDA_MEMCPY_DTOD 443
#define CUDA_MEMCPY_TO_SYMBOL 445
#define CUDA_MEMCPY_TO_SYMBOL_SHM 446
#define CUDA_MEMCPY_IB 447
#define CUDA_MEMCPY_MT_HTOD 449
#define CUDA_MEMCPY_MT_DTOH 450
#define CUDA_MEMCPY_MT_SYNC 451
#define CUDA_MEMSET 470
#define CUDA_MEMSET_2D 471
#define CUDA_MEMSET_2D_ASYNC 472
#define CUDA_MEMSET_3D 473
#define CUDA_MEMSET_3D_ASYNC 474
#define CUDA_MEMSET_ASYNC 475
#define CUDA_MEMCPY_HTOD_ASYNC 480
#define CUDA_MEMCPY_DTOH_ASYNC 481
#define CUDA_MEMCPY_DTOD_ASYNC 482
#define CUDA_DEVICE_CAN_ACCESS_PEER 500
#define CUDA_DEVICE_DISABLE_PEER_ACCESS 501
#define CUDA_DEVICE_ENABLE_PEER_ACCESS 502
#define CUDA_DRIVER_GET_VERSION 510
#define CUDA_RUNTIME_GET_VERSION 511
#define CUDA_PROFILER_START 701
#define CUDA_PROFILER_STOP 702
#define rpc_cuDeviceGetCount 1002
#define rpc_cuInit 1003
#define rpc_cuDriverGetVersion 1004
#define rpc_cuDeviceGet 1005
#define rpc_cuDeviceGetName 1006
#define rpc_cuDeviceTotalMem 1007
#define rpc_cuDeviceGetAttribute 1008
#define rpc_cuDeviceGetUuid 1009
#define rpc_cuCtxGetCurrent 1010
#define rpc_cuCtxSetCurrent 1011
#define rpc_cuDevicePrimaryCtxRetain 1012
#define rpc_cuModuleGetFunction 1013
#define rpc_cuMemAlloc 1015
#define rpc_cuCtxGetDevice 1016
#define rpc_cuMemcpyHtoD 1017
#define rpc_cuLaunchKernel 1018
#define rpc_cuModuleLoad 1019
#define rpc_cuGetErrorString 1020
#define rpc_cuModuleUnload 1021
#define rpc_cuDevicePrimaryCtxGetState 1022
#define rpc_cuDeviceGetProperties 1023
#define rpc_cuDeviceComputeCapability 1024
#define rpc_cuDeviceGetP2PAttribute 1025
#define rpc_cuModuleLoadData 1026
#define rpc_cusolverDnCreate 2001
#define rpc_cusolverDnSetStream 2002
#define rpc_cusolverDnDgetrf_bufferSize 2003
#define rpc_cusolverDnDgetrf 2004
#define rpc_cusolverDnDgetrs 2005
#define rpc_cusolverDnDestroy 2006
#define rpc_cublasCreate 3001
#define rpc_cublasDgemm 3002
#define rpc_cublasDestroy 3003
#define rpc_cublasSgemm 3004
#define rpc_cublasSgemv 3005
#define rpc_cublasDgemv 3006
#define rpc_cublasSgemmEx 3007
#define rpc_cublasSetStream 3008
#define rpc_cublasSetWorkspace 3009
#define rpc_cublasSetMathMode 3010
#define rpc_cublasSgemmStridedBatched 3011
#define rpc_nvmlDeviceGetCount_v2 4000
#define rpc_nvmlInitWithFlags 4001
#define rpc_nvmlInit_v2 4002
#define rpc_nvmlShutdown 4003
#define rpc_cudnnGetVersion 5000
#define rpc_cudnnGetMaxDeviceVersion 5001
#define rpc_cudnnGetCudartVersion 5002
#define rpc_cudnnGetErrorString 5003
#define rpc_cudnnQueryRuntimeError 5004
#define rpc_cudnnGetProperty 5005
#define rpc_cudnnCreate 5006
#define rpc_cudnnDestroy 5007
#define rpc_cudnnSetStream 5008
#define rpc_cudnnGetStream 5009
#define rpc_cudnnCreateTensorDescriptor 5010
#define rpc_cudnnSetTensor4dDescriptor 5011
#define rpc_cudnnSetTensor4dDescriptorEx 5012
#define rpc_cudnnGetTensor4dDescriptor 5013
#define rpc_cudnnSetTensorNdDescriptor 5014
#define rpc_cudnnSetTensorNdDescriptorEx 5015
#define rpc_cudnnGetTensorNdDescriptor 5016
#define rpc_cudnnGetTensorSizeInBytes 5017
#define rpc_cudnnDestroyTensorDescriptor 5018
#define rpc_cudnnTransformTensor 5024
#define rpc_cudnnAddTensor 5026
#define rpc_cudnnCreateFilterDescriptor 5041
#define rpc_cudnnSetFilter4dDescriptor 5042
#define rpc_cudnnGetFilter4dDescriptor 5043
#define rpc_cudnnSetFilterNdDescriptor 5044
#define rpc_cudnnGetFilterNdDescriptor 5045
#define rpc_cudnnGetFilterSizeInBytes 5046
#define rpc_cudnnTransformFilter 5047
#define rpc_cudnnDestroyFilterDescriptor 5048
#define rpc_cudnnSoftmaxForward 5049
#define rpc_cudnnCreatePoolingDescriptor 5050
#define rpc_cudnnSetPooling2dDescriptor 5051
#define rpc_cudnnGetPooling2dDescriptor 5052
#define rpc_cudnnSetPoolingNdDescriptor 5053
#define rpc_cudnnGetPoolingNdDescriptor 5054
#define rpc_cudnnGetPoolingNdForwardOutputDim 5055
#define rpc_cudnnGetPooling2dForwardOutputDim 5056
#define rpc_cudnnDestroyPoolingDescriptor 5057
#define rpc_cudnnPoolingForward 5058
#define rpc_cudnnCreateActivationDescriptor 5059
#define rpc_cudnnSetActivationDescriptor 5060
#define rpc_cudnnGetActivationDescriptor 5061
#define rpc_cudnnSetActivationDescriptorSwishBeta 5062
#define rpc_cudnnGetActivationDescriptorSwishBeta 5063
#define rpc_cudnnDestroyActivationDescriptor 5064
#define rpc_cudnnActivationForward 5065
#define rpc_cudnnCreateLRNDescriptor 5066
#define rpc_cudnnSetLRNDescriptor 5067
#define rpc_cudnnGetLRNDescriptor 5068
#define rpc_cudnnDestroyLRNDescriptor 5069
#define rpc_cudnnLRNCrossChannelForward 5070
#define rpc_cudnnCreateConvolutionDescriptor 5301
#define rpc_cudnnDestroyConvolutionDescriptor 5302
#define rpc_cudnnGetConvolutionNdForwardOutputDim 5303
#define rpc_cudnnSetConvolutionNdDescriptor 5304
#define rpc_cudnnGetConvolutionForwardAlgorithm_v7 5305
#define rpc_cudnnFindConvolutionForwardAlgorithm 5306
#define rpc_cudnnGetConvolutionForwardWorkspaceSize 5307
#define rpc_cudnnConvolutionForward 5308
#define rpc_cudnnSetConvolutionGroupCount 5309
#define rpc_cudnnSetConvolutionMathType 5310
#define rpc_cudnnGetBatchNormalizationForwardTrainingExWorkspaceSize 5311
#define rpc_cudnnBatchNormalizationForwardTrainingEx 5312
#define rpc_cudnnGetBatchNormalizationBackwardExWorkspaceSize 5313
#define rpc_cudnnBatchNormalizationBackwardEx 5314
#define rpc_cudnnGetConvolutionBackwardDataAlgorithm_v7 5315
#define rpc_cudnnConvolutionBackwardData 5316
#define rpc_cudnnGetConvolutionBackwardFilterAlgorithm_v7 5317
#define rpc_cudnnConvolutionBackwardFilter 5318
#define rpc_cudnnBatchNormalizationForwardInference 5319
